<!DOCTYPE html>
<html>
<head><title>代码提取</title><style>body{padding:20px;max-width:800px;margin:auto}pre{background:#f5f5f5;padding:10px;overflow:auto}</style></head>
<body>
<h3>网站代码提取</h3>
<input id="url" placeholder="输入URL" style="width:70%"><button onclick="extract()">提取</button>
<pre id="output"></pre>
<script>
async function extract(){
  let url = document.getElementById('url').value;
  if(!url) return alert('需要URL');
  try {
    let res = await fetch('https://api.allorigins.win/raw?url='+encodeURIComponent(url));
    document.getElementById('output').textContent = await res.text();
  } catch(e) { alert('错误: '+e); }
}
</script>
</body>
</html>